Defining a Database Exception

You can define a Database Exception for when a Database query fails.

Database Exception parameter is composed of text indicating the Exception type. This is equivalent to the Exception Description property of the Exception type.

To define  database exception:

1. Define an event handler in which you select the type of element to expose an event in the project:

2. Select the Data Connections option to display all the database connections:

3. Select the database command to be used:

4. Select the Exception event:

5. Use the Assignment tool to select the business entity to hold the exception message, as shown in the series of windows below:

The event handler informs you whenever a database action fails. Based on the message you receive, you can then use that logic in your project, as it is held as part of a business entity property. For example, in the window below, ExecuteNonQuery Error (highlighted in dark blue) is the type of database action that generated the exception.

The actual message that is triggered is highlighted in blue in the window below: